-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Social links: add background color block supports #43293
Social links: add background color block supports #43293
Conversation
Size Change: +154 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
"gradients": true, | ||
"text": false, | ||
"__experimentalDefaultControls": { | ||
"background": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure why I had to explicitly define text
and __experimentalDefaultControls.background
as false
, but a text control appeared and the background color control is default without them.
This also closes #39990. -When all 3 colors are selected, the contrast warning can show more than once. Is it possible to limit that to one? Should the colors be grouped inside the options modal? Right now, they are not: |
Thanks @carolinan !
Good catch. I've just been looking at this and it might be tricky, well, to do it via props. I can't see any way to hand down an The other way might be to add a prop to the block.json in 🤔
I think the two group represent those controls that are shown by default, and the one (background) that is not. If I'm not mistaken, that's expected ToolsPanel UI behaviour. |
Enable alpha for icons and icon background colors added in #43453
27c720e
to
b2dfb82
Compare
Now that #43357 is in, I've disabled the contrast checker for the background color.
Here's some test HTML. Example<!-- wp:social-links {"customIconColor":"#f5dac1","iconColorValue":"#f5dac1","customIconBackgroundColor":"#f5d7ba","iconBackgroundColorValue":"#f5d7ba","showLabels":true,"style":{"color":{"background":"#184043"}}} -->
<ul class="wp-block-social-links has-visible-labels has-icon-color has-icon-background-color has-background" style="background-color:#184043"><!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /--></ul>
<!-- /wp:social-links --> @ndiego I also had to rebase on top of #43453 to enable alpha controls. If you have a spare moment to double check this one before merging I'd be grateful. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - only one contrast alert showing now and related to contrast between icon and icon background colors
Related:
What?
Adding background color block supports to the social links block.
The background color is not displayed by default.
Text is deliberately omitted because it is handled by the bespoke
iconColorValue
attribute.Why?
To add the option to provide a background color to social icons blocks.
To create consistency across blocks.
How?
Making existing attribute color controls part of the colors tools panel.
Testing Instructions
Some example block HTML code - so you don't have to!
Screenshots or screencast
2022-08-17.12.45.12.mp4